public static string ToBase62(string hex) { string base62 = BaseConvert.Convert(hex, 16, 62); if (base62.Length >= 22) { return(base62); } else { return(new string('0', 22 - base62.Length) + base62); } }
public static string ToHex(string base62) { string hex = BaseConvert.Convert(base62, 62, 16); if (hex.Length >= 32) { return(hex); } else { return(new string('0', 32 - hex.Length) + hex); } }