버퍼 비교하기
이 예시 코드는 UWP(Universal Windows Platform) 앱에서 버퍼를 비교하는 방법을 보여 줍니다.
public void CompareBuffers()
{
// Create a hexadecimal string.
String strHex = "30310aff";
// Create a Base64 string that is equivalent to strHex.
String strBase64v1 = "MDEK/w==";
// Create a Base64 string that is not equivalent to strHex.
String strBase64v2 = "KEDM/w==";
// Decode strHex to a buffer.
IBuffer buff1 = CryptographicBuffer.DecodeFromHexString(strHex);
// Decode strBase64v1 to a buffer.
IBuffer buff2 = CryptographicBuffer.DecodeFromBase64String(strBase64v1);
// Decode strBase64v2 to a buffer.
IBuffer buff3 = CryptographicBuffer.DecodeFromBase64String(strBase64v2);
// Compare the hexadecimal-decoded buff1 to the Base64-decoded buff2.
// The code points in the two buffers are equal, and the Boolean value
// is true.
Boolean bVal_1 = CryptographicBuffer.Compare(buff1, buff2);
// Compare the hexadecimal-decoded buff1 to the Base64-decoded buff3.
// The code points in the two buffers are not equal, and the Boolean value
// is false.
Boolean bVal_2 = CryptographicBuffer.Compare(buff1, buff3);
}
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기