I am trying to make a regex test that returns true for the following conditions: Can only have letters A-F (case insensitive) First character must be ‘#’ Can have numbers 0-9 Does not have punctuation The order does not matter except that string[0] should be ‘#’. So far I have: /^#[A-F0-9^!G-Z]/i but for some reason, it returns strings that have
Tag: hex
Javascript hexadecimal to ASCII with latin extended symbols
I am getting a hexadecimal value of my string that looks like this: Hexadecimal value of this string is: The problem is that when i try to convert this value back to ascii it poorly converts the č,š,ř,.. and returns symbol of little box with question mark in it instead of these symbols. My code for converting hex to ascii:
How to convert Unicode Hex Characters to Latin-1 in JavaScript
I’m using rae-api to get the definition of the words in their dictionary. The problem is for example: I search for the definition of the word hola, it returns como salutación familiar.. I want to get the value of ó in Latin-1 characters: ó, therefore, the result would be como salutación familiar. getHex function removes &#; and returns xF3 to
How to remove the nth hexadecimal digit of a integer number without using Strings?
Consider a hexadecimal integer value such as n = 0x12345, how to get 0x1235 as result by doing remove(n, 3) (big endian)? For the inputs above I think this can be achieved by performing some bitwising steps: partA = extract the part from index 0 to targetIndex – 1 (should return 0x123); partB = extract the part from targetIndex +
Javascript: using the replace method on hex or dec character using the hex or dec value itself
I have a HTML table with a sorting function to sort in ascending or descending order by column. To show that I am using the down- and up- pointing small triangles with hex code x25BE; and x25B4; respectively. The problem is that I cannot replace these hex characters using the replace method. I can only do that by using the
Crypto.js decrypt with key and iv (vector) in byte arrays
I have to decrypt some strings which are AES encrypted. Example encrypted string: 129212143036071008133136215105140171136216244116 I have a key, and a vector (iv) supplied to me in a byte-array format: Key: [ 123, 217, 20, 11, 24, 26, 85, 45, 114, 184, 27, 162, 37, 115, 222, 209, 241, 24, 175, 144, 175, 53, 196, 29, 24, 23, 17, 218, 131,
Converting hexadecimal to float in JavaScript
I would like to convert a number in base 10 with fraction to a number in base 16. All is well there. Now I want to convert it back to decimal. But now I cannot write: As it doesn’t return the decimal part. And I cannot use parseFloat, since per MDC, the syntax of parseFloat is It wouldn’t have been