GO CREATE FUNCTION [dbo].[c_GetUTF8Code] ( @char Nchar ) RETURNS int AS --UTF8转码 BEGIN Declare @Code int Select @Code=Cast(Unicode(@char) as int) Declare @Utf8Code int ) begin --0-127 --0000-007F --0xxxxxxx --01100010 Unocide --01100010 UTF-8 Set @Ut
js代码 function encode64(input) { var output = ""; var base = new Base64(); var output = base.encode(input); return output; } function Base64() { // private property _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
项目中做云桌面对接,需要在项目中查出用户的明文密码,拼接到云桌面登陆地址中,防止明文传输,做了base64加密解密,防止小白黑客盗取用户密码. postgrelsql base64加密SQL语句: 查询用户证件号码后四位,base64加密的密码 SELECT substr(idno, length(idno) - 3) idno, ENCODE(cast(password as bytea),'base64') xm FROM security.oauth_user WHERE id = #{U