https://github.com/aeurum/pseudo-crypto
Hash numeric identifiers.
https://github.com/aeurum/pseudo-crypto
anonymization crypto data-masking fixed-width hash obfuscation pseudo pseudonymization
Last synced: 3 months ago
JSON representation
Hash numeric identifiers.
- Host: GitHub
- URL: https://github.com/aeurum/pseudo-crypto
- Owner: aeurum
- Created: 2024-09-15T16:29:36.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-09-15T16:40:31.000Z (9 months ago)
- Last Synced: 2025-01-10T16:20:06.536Z (5 months ago)
- Topics: anonymization, crypto, data-masking, fixed-width, hash, obfuscation, pseudo, pseudonymization
- Language: JavaScript
- Homepage:
- Size: 55.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pseudo Crypto
Pseudo Crypto can help you hash numeric identifiers.## Installation
```
npm i pseudo-crypto
```## Usage
```
const { PseudoCrypto } = require('pseudo-crypto')
// import { PseudoCrypto } from 'pseudo-crypto'const pc = {
numeric: new PseudoCrypto('09'),
uppercase: new PseudoCrypto('AZ'),
lowercase: new PseudoCrypto('az'),
lowercase_wide: new PseudoCrypto('l-'),
lowercase_inline: new PseudoCrypto('l_'),
alphabetic: new PseudoCrypto('Az'),
alphanumeric: new PseudoCrypto('AN') // default
}
console.log([
pc.numeric.hash(12345), // 81485
pc.uppercase.hash(12345, 6), // QJQYJR
pc.lowercase.hash(12345, 8), // qjpsdsql
pc.lowercase_wide.hash(12345, 10), // rerrowgbkd
pc.lowercase_inline.hash(12345, 12), // ueoevwcxavec
pc.alphabetic.hash(12345, 14), // gmVcZTCcUhvqOF
pc.alphanumeric.hash(12345, 16) // d29BtQouSWVtnhIX
].join('\n'))
```