Skip to content

Unpad hex #8

@kahwooi

Description

@kahwooi

How can unpad hex ...0020200030303 to ...0020200 ?

I am doing this:

let buffer = Buffer.from(paddedHex),
        bytes = new Uint8Array(buffer.length),
        i = buffer.length;

      while (i--) {
        bytes[i] = buffer[i];
      }

      Buffer.from(pkcs7.unpad(bytes)).toString('hex')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions