fpe-map
v0.1.2
Published
[](https://github.com/estarriolvetch/fpe-map/actions/workflows/node.js.yml) [
- Litepaper: https://mirror.xyz/ctor.xyz/ZEY5-wn-3EeHzkTUhACNJZVKc0-R6EsDwwHMr5YJEn0
Installaion
npm
npm install fpe-mapyarn
yarn add fpe-mapUsage
The easiest way to use FPE Map is using fpeMappingFeistelAuto which automatically configure the block size of the encryption core and other parameters within the algorithm.
uint256 metadataId = FPEMap.fpeMappingFeistelAuto(tokenId, randomSeed, maxSupply) If the token ID is not starting from 0, one can do a simple modification to include that.
uint256 metadataId = startTokenId +
FPEMap.fpeMappingFeistelAuto(tokenId - startTokenId, randomSeed, maxSupply) 