INNER CODE UNIT · JavaScript
addDigit
jofpin/temcrypt · temcrypt.js:282
let addDigit = 1 + Math.floor((this.core.date.CURRENT.getFullYear() - this.core.date.START.getFullYear()) / this.core.time.DIGIT_UPGRADE_YEARS);
return {
value: Math.pow(10, addDigit),
saltIncrease: Math.floor(Math.random() * Math.pow(10, addDigit)).toString()
};
},
/**
* multiLayer: Generates a multi-layer encryption by applying multiple encryption rounds to the provided data.
*/
multiLayer: function(data, mainKeyComposition) {
// The first encryption layer using the first half of the key composition.
const encryptionLayerOne = this.helper(JSON.stringify(data)).enc256(this.helper().splitKey(mainKeyComposition).one);
// The second encryption layer using the second half of the key composition.
const encryptionLayerTwo = this.helper(encryptionLayerOne).enc256(this.helper().splitKey(mainKeyComposition).two);
// Reverses the characters of the second encryption layer and applies the setting the current seconds obtained from based on this.baseTime().seconds
// Convert the encryptionLayerTwo to a UTF-8 encoded string and then convert it to Hexadecimal format.