1e41f4b71Sopenharmony_ci# Util Subsystem Changelog 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ciCompared with OpenHarmony 3.2 Beta4, OpenHarmony 3.2.10.7(MR) has the following API changes in the util subsystem. 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci## cl.util.1. randomUUID Name Changed 6e41f4b71Sopenharmony_ciThe **randomUUID** function name is changed to **generateRandomUUID**. 7e41f4b71Sopenharmony_ci 8e41f4b71Sopenharmony_ciBefore change: function randomUUID(entropyCache?: boolean): string <br>After change: function generateRandomUUID(entropyCache?: boolean): string 9e41f4b71Sopenharmony_ci 10e41f4b71Sopenharmony_ciYou need to adapt your application. 11e41f4b71Sopenharmony_ci 12e41f4b71Sopenharmony_ci**Change Impact** 13e41f4b71Sopenharmony_ci 14e41f4b71Sopenharmony_ciJS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement features in the SDK environment of the new version. 15e41f4b71Sopenharmony_ci 16e41f4b71Sopenharmony_ci**Key API/Component Changes** 17e41f4b71Sopenharmony_ci 18e41f4b71Sopenharmony_ci| Module | Method/Attribute/Enum/Constant | Change Type| 19e41f4b71Sopenharmony_ci| :---------- | ------------------- | ------- | 20e41f4b71Sopenharmony_ci| @ohos.util | function randomUUID(entropyCache?: boolean): string | Deleted | 21e41f4b71Sopenharmony_ci| @ohos.util | function generateRandomUUID(entropyCache?: boolean): string| Added | 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ci**Adaptation Guide** 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ciRefer to the code snippet below to call **generateRandomUUID** in your application. 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ciExample: 28e41f4b71Sopenharmony_ci 29e41f4b71Sopenharmony_ci```ts 30e41f4b71Sopenharmony_ciimport util from '@ohos.util' 31e41f4b71Sopenharmony_cilet uuid = util.generateRandomUUID(true); 32e41f4b71Sopenharmony_ciconsole.log("RFC 4122 Version 4 UUID:" + uuid); 33e41f4b71Sopenharmony_ci// Output: 34e41f4b71Sopenharmony_ci// RFC 4122 Version 4 UUID:88368f2a-d5db-47d8-a05f-534fab0a0045 35e41f4b71Sopenharmony_ci``` 36e41f4b71Sopenharmony_ci 37e41f4b71Sopenharmony_ci## cl.util.2 randomBinaryUUID Name Changed 38e41f4b71Sopenharmony_ciThe **randomBinaryUUID** function name is changed to **generateRandomBinaryUUID**. 39e41f4b71Sopenharmony_ci 40e41f4b71Sopenharmony_ciBefore change: function randomBinaryUUID(entropyCache?: boolean): Uint8Array<br>After change: function generateRandomBinaryUUID(entropyCache?: boolean): Uint8Array 41e41f4b71Sopenharmony_ci 42e41f4b71Sopenharmony_ciYou need to adapt your application. 43e41f4b71Sopenharmony_ci 44e41f4b71Sopenharmony_ci**Change Impact** 45e41f4b71Sopenharmony_ci 46e41f4b71Sopenharmony_ciJS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement features in the SDK environment of the new version. 47e41f4b71Sopenharmony_ci 48e41f4b71Sopenharmony_ci**Key API/Component Changes** 49e41f4b71Sopenharmony_ci 50e41f4b71Sopenharmony_ci| Module | Method/Attribute/Enum/Constant | Change Type| 51e41f4b71Sopenharmony_ci| :---------- | ------------------- | ------- | 52e41f4b71Sopenharmony_ci| @ohos.util | function randomBinaryUUID(entropyCache?: boolean): Uint8Array; | Deleted | 53e41f4b71Sopenharmony_ci| @ohos.util | function generateRandomBinaryUUID(entropyCache?: boolean): Uint8Array| Added | 54e41f4b71Sopenharmony_ci 55e41f4b71Sopenharmony_ci**Adaptation Guide** 56e41f4b71Sopenharmony_ci 57e41f4b71Sopenharmony_ciRefer to the code snippet below to call **generateRandomBinaryUUID** in your application. 58e41f4b71Sopenharmony_ci 59e41f4b71Sopenharmony_ciExample: 60e41f4b71Sopenharmony_ci 61e41f4b71Sopenharmony_ci```ts 62e41f4b71Sopenharmony_ciimport util from '@ohos.util' 63e41f4b71Sopenharmony_cilet uuid = util.generateRandomBinaryUUID(true); 64e41f4b71Sopenharmony_ciconsole.log(JSON.stringify(uuid)); 65e41f4b71Sopenharmony_ci// Output: 66e41f4b71Sopenharmony_ci// 138,188,43,243,62,254,70,119,130,20,235,222,199,164,140,150 67e41f4b71Sopenharmony_ci``` 68e41f4b71Sopenharmony_ci 69e41f4b71Sopenharmony_ci## cl.util.3. contains Parameter Type in the LRUCache Class Changed 70e41f4b71Sopenharmony_ciThe **contains** parameter type in the LRUCache class is changed from **object** to **K**. 71e41f4b71Sopenharmony_ci 72e41f4b71Sopenharmony_ciBefore change: contains(key: object): boolean <br>After change: contains(key: K): boolean 73e41f4b71Sopenharmony_ci 74e41f4b71Sopenharmony_ciYou need to adapt your application. 75e41f4b71Sopenharmony_ci 76e41f4b71Sopenharmony_ci**Change Impact** 77e41f4b71Sopenharmony_ci 78e41f4b71Sopenharmony_ciJS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement features in the SDK environment of the new version. 79e41f4b71Sopenharmony_ci 80e41f4b71Sopenharmony_ci**Key API/Component Changes** 81e41f4b71Sopenharmony_ci 82e41f4b71Sopenharmony_ci| Module | Class | Method/Attribute/Enum/Constant | Change Type| 83e41f4b71Sopenharmony_ci| :-------- | ---------| -------------------------------- | -------- | 84e41f4b71Sopenharmony_ci| @ohos.util | LRUCache | contains(key: object): boolean | Deleted | 85e41f4b71Sopenharmony_ci| @ohos.util | LRUCache | contains(key: K): boolean | Added | 86e41f4b71Sopenharmony_ci 87e41f4b71Sopenharmony_ci**Adaptation Guide** 88e41f4b71Sopenharmony_ci 89e41f4b71Sopenharmony_ciFollow the code snippet to use the **contains** function in your application. 90e41f4b71Sopenharmony_ci 91e41f4b71Sopenharmony_ciExample: 92e41f4b71Sopenharmony_ci 93e41f4b71Sopenharmony_ci```ts 94e41f4b71Sopenharmony_ciimport util from '@ohos.util' 95e41f4b71Sopenharmony_cilet pro = new util.LRUCache(); 96e41f4b71Sopenharmony_cipro.put(2,10); 97e41f4b71Sopenharmony_cilet obj = {1:"key"}; 98e41f4b71Sopenharmony_cilet result = pro.contains(obj); 99e41f4b71Sopenharmony_ci``` 100