컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
strings.from_hex
strings.from_hex(hex_string)
설명
지정된 16진수 문자열과 연결된 바이트를 반환합니다.
매개변수 데이터 유형
STRING
반환 유형
BYTES
코드 샘플
지정된 16진수 문자열과 연결된 바이트를 가져옵니다.
예 1
이 예에서는 16진수 이외의 문자 전환을 보여줍니다.
strings.from_hex("str") // returns empty bytes
예 2
이 예시에서는 빈 문자열이 있는 입력을 보여줍니다.
strings.from_hex("") // returns empty bytes
예시 3
이 예에서는 16진수 문자열 전환을 보여줍니다.
strings.from_hex("1234") // returns 1234 bytes
예 4
이 예에서는 비ASCII 문자 전환을 보여줍니다.
strings.from_hex("筒纸.中国") // returns empty bytes
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 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\u003estrings.from_hex\u003c/code\u003e converts a hexadecimal string into its corresponding bytes representation, usable in Rules and Search.\u003c/p\u003e\n"],["\u003cp\u003eThe function accepts a single string parameter (\u003ccode\u003eSTRING\u003c/code\u003e) and returns a \u003ccode\u003eBYTES\u003c/code\u003e data type.\u003c/p\u003e\n"],["\u003cp\u003eProviding a non-hexadecimal string or an empty string to \u003ccode\u003estrings.from_hex\u003c/code\u003e results in empty bytes.\u003c/p\u003e\n"],["\u003cp\u003eOnly hexadecimal strings, like \u003ccode\u003e"1234"\u003c/code\u003e, will be converted successfully to their byte values, as shown in the example.\u003c/p\u003e\n"]]],[],null,["### strings.from_hex\n\nSupported in: \n[Rules](/chronicle/docs/detection/default-rules) [Search](/chronicle/docs/investigation/udm-search) \n\n strings.from_hex(hex_string)\n\n#### Description\n\nReturns the bytes associated with the given hex string.\n\n#### Param data types\n\n`STRING`\n\n#### Return type\n\n`BYTES`\n\n#### Code samples\n\nGet bytes associated with a given hex string.\n\n##### Example 1\n\nThis example shows non-hex character conversions. \n\n strings.from_hex(\"str\") // returns empty bytes\n\n##### Example 2\n\nThis example shows input with empty string. \n\n strings.from_hex(\"\") // returns empty bytes\n\n##### Example 3\n\nThis example shows hex string conversion. \n\n strings.from_hex(\"1234\") // returns 1234 bytes\n\n##### Example 4\n\nThis example shows non-ASCII characters conversion. \n\n strings.from_hex(\"筒纸.中国\") // returns empty bytes"]]