@solariera/scramble-number
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

Scramble Number

npm npm npm bundle size

This package generates a scrambled number.

1. Usage

1-1. Installation

# npm
npm install @solariera/scramble-number
# yarn
yarn add @solariera/scramble-number

1-2. Basic Usage

import { scramble, generateSalt } from '@solariera/scramble-number';

const [salt, _salt] = generateSalt();

const scrambled = [0, 1, 2, 3, 4].map((num) => scramble(num, salt, _salt));

console.log(scrambled);
// e.g. [1219901536, 239563430, 953425272, 1286381126, 1451104176]

2. Specifications

2-1. Syntax & Parameters

scramble(value, salt, inversedSalt)

No. Name Type Required Description
1 value number Yes Original Value
1 salt number Yes Salt
2 inversedSalt number Yes Inversed Salt

/@solariera/scramble-number/

    Package Sidebar

    Install

    npm i @solariera/scramble-number

    Weekly Downloads

    3

    Version

    0.0.2

    License

    MIT

    Unpacked Size

    8.4 kB

    Total Files

    25

    Last publish

    Collaborators

    • solariera