maintenance
This commit is contained in:
20
src/utility/conversions.ts
Normal file
20
src/utility/conversions.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Copyright 2024 Phenix Real Time Solutions, Inc. Confidential and Proprietary. All Rights Reserved.
|
||||
*/
|
||||
import countryMapping from 'services/files/countries_mapping.json';
|
||||
|
||||
export const getCountryFullName = (shortName: string): string => {
|
||||
return countryMapping[shortName] || 'Unknown';
|
||||
};
|
||||
|
||||
// Matches Java's implementation of the standard object.hashCode() for CharSequence
|
||||
export const createHashFromString = (string: string): number => {
|
||||
let hash = 0;
|
||||
let i = 0;
|
||||
|
||||
while (i < string.length) {
|
||||
hash = ((hash << 5) - hash + string.charCodeAt(i++)) << 0;
|
||||
}
|
||||
|
||||
return hash;
|
||||
};
|
||||
Reference in New Issue
Block a user