base36

Java: convert byte[] to base36 String

主宰稳场 提交于 2021-02-07 12:29:19
问题 I'm a bit lost. For a project, I need to convert the output of a hash-function (SHA256) - which is a byte array - to a String using base 36. So In the end, I want to convert the (Hex-String representation of the) Hash, which is 43A718774C572BD8A25ADBEB1BFCD5C0256AE11CECF9F9C3F925D0E52BEAF89 to base36, so the example String from above would be: 3SKVHQTXPXTEINB0AT1P0G45M4KI8U0HR8PGB96DVXSTDJKI1 For the actual conversion to base36, I found some piece of code here on StackOverflow: public static

Java: convert byte[] to base36 String

夙愿已清 提交于 2021-02-07 12:29:18
问题 I'm a bit lost. For a project, I need to convert the output of a hash-function (SHA256) - which is a byte array - to a String using base 36. So In the end, I want to convert the (Hex-String representation of the) Hash, which is 43A718774C572BD8A25ADBEB1BFCD5C0256AE11CECF9F9C3F925D0E52BEAF89 to base36, so the example String from above would be: 3SKVHQTXPXTEINB0AT1P0G45M4KI8U0HR8PGB96DVXSTDJKI1 For the actual conversion to base36, I found some piece of code here on StackOverflow: public static

How to check if VARCHAR strings are (not) hexadecimal?

耗尽温柔 提交于 2020-12-10 13:28:29
问题 TL;DR How to test if string is hex when selecting rows? If I had a table with GUIDs where some of them are Base36 instead if hexadecimal: ID | GUID ===|================================= 1 | CAFEBABECAFED00DB16B00B515BADA55 2 | 0123456789ABCDEFGHIJKLMNOPQRSTUV 3 | DEADBEAF4D15EA5EDEFEC8EDFEE1DEAD I want to get all rows with GUIDs that are not exclusively hexadecimal. For a singleton, I could try CONVERT(VARBINARY(32),[GUID],2) and see if it fails, but I can’t to that in a query. If I could

How to check if VARCHAR strings are (not) hexadecimal?

混江龙づ霸主 提交于 2020-12-10 13:22:13
问题 TL;DR How to test if string is hex when selecting rows? If I had a table with GUIDs where some of them are Base36 instead if hexadecimal: ID | GUID ===|================================= 1 | CAFEBABECAFED00DB16B00B515BADA55 2 | 0123456789ABCDEFGHIJKLMNOPQRSTUV 3 | DEADBEAF4D15EA5EDEFEC8EDFEE1DEAD I want to get all rows with GUIDs that are not exclusively hexadecimal. For a singleton, I could try CONVERT(VARBINARY(32),[GUID],2) and see if it fails, but I can’t to that in a query. If I could

Looking for a way to have a base36 sequence in C#

懵懂的女人 提交于 2020-01-17 07:14:49
问题 In my application I use sequences. These are stored in Azure table storage as strings. To update the sequence I get the latest number as a string, convert to a number, add to the number and store it back as the current sequence value. The sequences are used internally as unique keys but they are also visible in URLs to the user so I would like to keep them short. What I am considering is the idea of having a sequence in base36. In other words 0-Z. Does anyone have any idea how I can get a

How can I filter out profanity in base36 IDs?

此生再无相见时 提交于 2019-12-22 07:08:32
问题 I want to use base36 in a web application I am developing... but as the id is visible to users as a url, I want to filter out profanity. Has anyone solved this? Or is this even a real problem? Does it make sense just to skip numbers in my database sequence? 回答1: Well, rather than try to amass all the swear words possible, just filter out the vowels. That'll leave you plenty of permutations in the space. Admittedly, you've just cut down from base 36 to base 31, but base 31 numbers are valid

Increment an index that uses numbers and characters (aka Base36 numbers)

好久不见. 提交于 2019-12-20 02:16:27
问题 I have a string based code that can be either two or three characters in length and I am looking for some help in creating a function that will increment it. Each 'digit' of the code has a value of 0 to 9 and A to Z. some examples: the first code in the sequence is 000 009 - next code is - 00A 00D - next code is - 00E AAZ - next code is - AB0 the last code is ZZZ. Hope this makes some sense. 回答1: Maintain the counter as an int and increment this. Convert the int to your character

Convertions between decimal and base 36

白昼怎懂夜的黑 提交于 2019-12-12 10:56:43
问题 I want to convert numbers in base 36 using PHP. The function base_convert is not working because I want to convert large numbers: I don't get my initial number if I convert it again from base 36 to decimal. I tried some function given on multiple websites, but I never get the same result. Also, these two websites (in Javascript) give the same result: http://www.unitconversion.org/numbers/base-10-to-base-36-conversion.html http://www.translatorscafe.com/cafe/units-converter/numbers/calculator

How can I filter out profanity in base36 IDs?

好久不见. 提交于 2019-12-05 08:48:34
I want to use base36 in a web application I am developing... but as the id is visible to users as a url, I want to filter out profanity. Has anyone solved this? Or is this even a real problem? Does it make sense just to skip numbers in my database sequence? x0n Well, rather than try to amass all the swear words possible, just filter out the vowels. That'll leave you plenty of permutations in the space. Admittedly, you've just cut down from base 36 to base 31, but base 31 numbers are valid base 36 numbers assuming the same symbol set (a-z0-9). IF that bothers you, replace the five vowels with

Datatype to store 20 digit number

瘦欲@ 提交于 2019-11-28 13:38:06
I have a number of 20 digit, which datatype will support to store this number? I have tried long, double but I 'm getting out of range. Number = 48565664968483514466 Then I have to convert this number to Base36 to generate the barcode. BigInteger: The BigInteger class allocates as much memory as it needs to hold all the bits of data it is asked to hold and also provides operations analogues to all of Java's primitive integer operators and for all relevant methods from java.lang.Math. Declare it as BigInteger bi1 = new BigInteger("12345678900123"); To convert your number in base 36: BigInteger