https://github.com/lloydmeta/pseudo_encrypt-rs
A native Rust generic implementation of the pseudo_encrypt function from Psql
https://github.com/lloydmeta/pseudo_encrypt-rs
postgresql pseudo-encrypt pseudoencrypt psql rust
Last synced: 8 months ago
JSON representation
A native Rust generic implementation of the pseudo_encrypt function from Psql
- Host: GitHub
- URL: https://github.com/lloydmeta/pseudo_encrypt-rs
- Owner: lloydmeta
- Created: 2020-10-29T03:03:12.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-12-20T12:52:42.000Z (over 5 years ago)
- Last Synced: 2025-02-01T02:04:31.242Z (over 1 year ago)
- Topics: postgresql, pseudo-encrypt, pseudoencrypt, psql, rust
- Language: Rust
- Homepage:
- Size: 8.79 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## pseudo_encrypt-rs
[](https://github.com/lloydmeta/pseudo_encrypt-rs/actions?query=branch%3Amain)
[](https://docs.rs/pseudo_encrypt)
[](https://crates.io/crates/pseudo_encrypt)
This is a native Rust generic implementation of the `pseudo_encrypt` function [from Psql](https://wiki.postgresql.org/wiki/Pseudo_encrypt)
> 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:
- i32
- u32
- i64
- u64
- i128
- u128