Crates.io | pseudo_encrypt |
lib.rs | pseudo_encrypt |
version | 0.1.3 |
source | src |
created_at | 2020-10-29 03:24:33.433702 |
updated_at | 2020-10-31 13:00:08.938381 |
description | Provides a native-Rust generic implementation of Psql's pseudo_encrypt |
homepage | |
repository | https://github.com/lloydmeta/pseudo_encrypt-rs |
max_upload_size | |
id | 306541 |
size | 16,498 |
This is a native Rust generic implementation of the pseudo_encrypt
function from Psql
pseudo_encrypt(int) can be used as a pseudo-random generator of unique values. It produces an integer output that is uniquely associated to its integer input (by a mathematical permutation), but looks random at the same time, with zero collision. This is useful to communicate numbers generated sequentially without revealing their ordinal position in the sequence (for ticket numbers, URLs shorteners, promo codes...
There is out of the box support for integer primitives that are 32bit and up: