I would use the "Database Identifier" Attribute and "Identifier" and "File Name".
Base 64 uses two character sets.
Data: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/ URLs: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_
To use base 64, you need to defer your value to a multiple of 3 bytes (24 bits), and then split these 24 bits into 4 6-bit bytes. Each 6-bit value is scanned by the position in the line indicated above.
If all goes well, your final base64 value will always be a multiple of 4 characters and will be decoded back to a multiple of 3 (8 bits) bytes.
Depending on the language you use, many of them have built-in encoding and decoding functions.
source share