staticrypt-once
Version:
Fork of the main staticrypt package, adding passphrase storage in (in clear text) in either sessionStorage or localStorage.
15 lines (14 loc) • 461 B
JavaScript
function passphraseStorageFactory (storageType) {
return {
store: function (passphrase) {
return window[storageType].setItem("passphrase", passphrase)
},
get: function () {
return window[storageType].getItem("passphrase")
},
remove: function () {
return window[storageType].removeItem("passphrase")
}
}
}
const passphraseStorage = passphraseStorageFactory(storageType)