简体   繁体   English

Javascript-将字符串转换为UTF-16

[英]Javascript - Convert string to UTF-16

I am working with Javascript for one of the first times and its for a sha-1 hash. 我是第一次使用Javascript,并且它是用于sha-1哈希的。 I have found code to do this, but one of its dependencies is a method to convert the string to utf-8, however the server I am comparing against utilizes utf-16. 我已经找到执行此操作的代码,但是其依赖项之一是将字符串转换为utf-8的方法,但是我要比较的服务器使用utf-16。 I have looked around and all my results keep showing up w/ utf-8. 我环顾四周,所有结果都显示为utf-8。 Can anybody at least point me in the right direction? 至少有人能指出我正确的方向吗? Thanks. 谢谢。

Javascript已在内部使用UTF-16-使用charCodeAt()获取值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM