aesid
v5.2.1
Published
aes for sid
Readme
AESID
Install
npm install aesid --save
Usage
import { AesId } from 'aesid';
const sidAes = new AesId([
// mulit versions
{ version: 2, aes: 'old test aes key' },
{ version: 5, aes: 'new test aes key' },
], {
userid: true, // true/false/auto
});
const sid = sidAes.encrypt('encrypt content', 'userid');
const content = sidAes.decrypt(sid, 'userid');useridand DecryptData can only bestringorBuffer. If the type is notstringorbuffer, it will be forcibly cast tostring.
Upgrade
5.x
- remove the
useridoption and adduseridto theaesVersoption accordingly. - remove
option.userid=auto. - throw error if
useridstatus of sid flag andoption.useridare not the same.
4.x
- export
AesIdclass - remove
isfunc
