Skip to content

A native Rust generic implementation of the pseudo_encrypt function from Psql

Notifications You must be signed in to change notification settings

lloydmeta/pseudo_encrypt-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pseudo_encrypt-rs

pseudo_encrypt-rs-CI pseudo_encrypt Crates.io

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:

  • i32
  • u32
  • i64
  • u64
  • i128
  • u128

About

A native Rust generic implementation of the pseudo_encrypt function from Psql

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages