eg converting "pink" to "70696e6b"
now, I've been using the following, but it runs into problems when I have non-English characters like letters with accent marks
Code: Select all
function stringToHex pUsername
repeat for each char X in pUsername
put charToNum(X) into tDecNum
put baseConvert(tDecNum,10,16) after tHexNum
end repeat
return tHexNum
end stringToHex
background: I am using a module in CouchDB that automatically creates and configures a new database for every new user that signs up. The username created is converted to Hex, and then the database is named "user-" and the hex result. So in order to access the database, when the user logins, I need to be able to accurately create the database name.