Skip to main content
This method will decrement the integer value in a Data Object by a certain constant (non-negative). You can always increment it. Note, this method does not allow integer overflows, i.e. if you decrement by a constant that would result in an overflow, an error will be thrown. Note also that you can use the Feature lock in the Access Token to specify the upper bound of the decrement constant. So, if you only want to allow decrementing by 1, please set Feature lock field to 1 also. Please see Remarks for more details (including access token setup). This method is accessed in several ways. Each way works in the same way and requires the same permission. The only difference is the type of parameters. Both cases are listed below:

Parameters

Method 1 (general): https://api.cryptolens.io/api/data/DecrementIntValue Method 2 (key specific): https://api.cryptolens.io/api/data/DecrementIntValueToKey There are two ways to call this method: Method 3 (machine code specific): https://api.cryptolens.io/api/data/DecrementIntValueToMachineCode There are two ways to call this method:

Results

Example results

Remarks

  • The sign of the IntValue (decrementing constant) parameter will not be taken into account, i.e. -5 is treated as 5.
  • Integer overflows are not allowed. If you attempt to decrement by constant that would result in an integer overflow, an error will be thrown and no changes are going to be made.
  • Feature lock in Access Token can be used as a way to specify the upper bound for the IntValue (decrementing constant). If Feature lock is not 0, the value of the Feature lock will function as an upper bound. So, if you only want to allow decrementing by 1, please set Feature lock to 1
  • The EnableBound option allows you to specify a lower bound for the decrement operation. That is, if you want to force this method to stop at zero (eg. allow only positive values), you can specify the Bound to be 0. In this case, when the int value reaches zero, it will no longer be possible to decrement the int value. This condition is temporal, i.e. by modifying the lower bound parameter, you can achieve a different lower bound.
  • When accessing the key specific methods (using productId and the key string), you need to either disable key lock (set it to zero) or set it to a negative number, in the same way you would have done if you would have used KeyLock. We recommend to set the KeyLock to -1 when creating the access token.

Errors