You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
353 B
10 lines
353 B
/**
|
|
* Returns the subarray of a Uint8Array without PKCS#7 padding.
|
|
*
|
|
* @param padded {Uint8Array} unencrypted bytes that have been padded
|
|
* @return {Uint8Array} the unpadded bytes
|
|
* @see http://tools.ietf.org/html/rfc5652
|
|
*/
|
|
export default function unpad(padded) {
|
|
return padded.subarray(0, padded.byteLength - padded[padded.byteLength - 1]);
|
|
}
|
|
|