JS conversion into the system, divided into 2, 8, 10, 16 to the conversion between the system, we directly use the object. ToString () can be achieved by:
Run the following code
10 into 16
(in). ToString//=> "a"
//8 into 16
(012). ToString (a)//=> "a"
//16 into 10 system
(0x16). ToString (a)//=> "//16" into
8
(0x16). ToString (8)//=> "//10" to 2 into the system
//=>
(1111). ToString (2)//=> "10001010111"
//8 into the 2 system//=>
(01111). ToString (2)//=> "1001001001 "
//16 into the 2//=>
(0x16). toString (2)//=>" 10110 "
If you want to process 2 to 10, 16 to 10, 8 to 10, you need to use the Paresint method:
Run the following code
2 to 10
parseint (10,2)//=>2
//2 to 10; parseint
(100,2)//=>4//16
to 10
system parseint (a)//=>18//8 into
10
parseint (12,8);//=>10
In-process conversion
If you want to achieve the conversion between the system, you can use the Parseint method, first convert to 10, and then use ToString (parameter), into different systems;
Using the ToString and Parseint methods, you can implement a tool for transforming into a system:
Run the following code
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
Simple encryption decryption
Converts a string to Unicode, then converts Unicode to a different system, implementing Code Encryption Processing:
Run the following code
0 wide characters
With a width of 0 wide characters, we convert all strings to binary and then use 0-wide characters to represent them, then the resulting string will be 0, and the main decompile can be restored.
Run the following code
The above is a small set of JS in the introduction of the conversion and the role of all the narration, hope to help everyone, if you want to know more content, please pay attention to cloud Habitat community website!