Useful snippets

This is for small stuff I don’t want to forget, usually too small to deserve a blog post of its own.

1 Response to Useful snippets

  1. eidand's avatar eidand says:

    for base64 decoding to a specific byte[] size

    A byte uses 4/3 characters, so x number of bytes uses (x*4+2)/3 data characters. For 32 bytes that is 43 characters, and then it has a single = to pad it to an even four-character boundary

Leave a comment