Skip to main content
. 2024 Nov 20;24(22):7384. doi: 10.3390/s24227384
Algorithm 3. Check Counterfeiting Product
1: function CHECKCOUNTERFEITINGPROCESS (Nnv)
2: Input: T transaction   ▷ transaction of checking of products in blockchain
3: Output: S Boolean ▷ State of the product in the blockchain.
4:        P1 = getProductIdFromTransaction (T)
5: List <Product> Products = getValidatedProductFromBlockChain()
6:for each product Pi in Products do
7:                 if Pi = P1 then
8:                  S ← true
9:         else if Pi != P1 then
10:                      S    false
11:                end if
12:          end for
13: Return S
14: end function