컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
hash.sha256
hash.sha256(string)
설명
입력 문자열의 SHA-256 해시를 반환합니다.
매개변수 데이터 유형
STRING
반환 유형
STRING
코드 샘플
예 1
이 예에서는 입력이 유효한 문자열인 경우의 SHA-256 해시를 보여줍니다.
hash.sha256("str") = "8c25cb3686462e9a86d2883c5688a22fe738b0bbc85f458d2d2b5f3f667c6d5a"
예 2
이 예에서는 입력이 빈 문자열일 때의 SHA-256 해시를 보여줍니다.
hash.sha256("") = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-29(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-29(UTC)"],[[["\u003cp\u003e\u003ccode\u003ehash.sha256\u003c/code\u003e is a function that computes the SHA-256 hash of a given string.\u003c/p\u003e\n"],["\u003cp\u003eThe function accepts a \u003ccode\u003eSTRING\u003c/code\u003e as input and returns a \u003ccode\u003eSTRING\u003c/code\u003e as output.\u003c/p\u003e\n"],["\u003cp\u003eThe SHA-256 hash of a non-empty string, such as "str," results in "8c25cb3686462e9a86d2883c5688a22fe738b0bbc85f458d2d2b5f3f667c6d5a".\u003c/p\u003e\n"],["\u003cp\u003eThe SHA-256 hash of an empty string returns a fixed value of "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855".\u003c/p\u003e\n"]]],[],null,["### hash.sha256\n\nSupported in: \n[Rules](/chronicle/docs/detection/default-rules) \n\n hash.sha256(string)\n\n#### Description\n\nReturns a SHA-256 hash of the input string.\n\n#### Param data types\n\n`STRING`\n\n#### Return type\n\n`STRING`\n\n#### Code samples\n\n##### Example 1\n\nThis example shows the SHA-256 hash when the input is a valid string. \n\n hash.sha256(\"str\") = \"8c25cb3686462e9a86d2883c5688a22fe738b0bbc85f458d2d2b5f3f667c6d5a\"\n\n##### Example 2\n\nThis example shows the SHA-256 hash when the input is an empty string. \n\n hash.sha256(\"\") = \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\""]]