diff --git a/sdk/api/@ohos.util.ets b/sdk/api/@ohos.util.ets index 1d78c433c544d469b061fe1a7a89242e69951d8f..5dada93e4f8c6345406142fc2068707fb210920d 100644 --- a/sdk/api/@ohos.util.ets +++ b/sdk/api/@ohos.util.ets @@ -1040,4 +1040,14 @@ export namespace util { private static native doEncodeInfoUint8Array( input: string, inputEncoding: string, destArray: Uint8Array): EncodeIntoUint8ArrayInfo; } + + /** + * Get the hash code of an object. + * @param { object } [object] - The object that need to get hash code. + * @returns { number } Return a hash code of an object. + */ + export function getHash(obj: object): number { + let result: number = obj.$_hashCode(); + return result; + } } // namespace Util \ No newline at end of file