Files
WebControlCenter/src/utility/conversions.ts
2025-09-04 20:25:15 -04:00

21 lines
595 B
TypeScript

/**
* 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;
};