feat: WEB-210 Updated encryption to concat buffers instead of result
This commit is contained in:
@@ -13,8 +13,10 @@ export default function encryptValue(originalString: string) {
|
||||
let paddingSize =
|
||||
bufferKey.length - (bufferString.length % bufferKey.length)
|
||||
let paddedStr = Buffer.concat([bufferString, Buffer.alloc(paddingSize, 0)])
|
||||
result = cipher.update(paddedStr).toString("base64")
|
||||
result = (result + cipher.final("base64")).replace(/\+/g, "-")
|
||||
const buffers: Buffer[] = []
|
||||
buffers.push(cipher.update(paddedStr))
|
||||
buffers.push(cipher.final())
|
||||
result = Buffer.concat(buffers).toString("base64").replace(/\+/g, "-")
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user