2014. 5. 2. 00:53
c#
c# web safe base64
기본적으로 c#의 base64로 변환후 스트링의 Replace기능을 이용해서
+는 -로 /는 _로 변환하면된다.
string strInput = "base64로 바꿀 문자열";
string strWebSafeBase64 = Convert.ToBase64String(Encoding.UTF8.GetBytes(strInput)).Replace('+', '-').Replace('/', '_');
+는 -로 /는 _로 변환하면된다.
string strInput = "base64로 바꿀 문자열";
string strWebSafeBase64 = Convert.ToBase64String(Encoding.UTF8.GetBytes(strInput)).Replace('+', '-').Replace('/', '_');
'c#' 카테고리의 다른 글
네이버 앱스토어 인앱영수증 검증 c#버전 (0) | 2015.09.13 |
---|---|
c#에서 자바의 ByteBuffer 구현하기 (0) | 2014.05.05 |
심플 타임체커 (0) | 2014.05.04 |