export function encryptPassword(password) {
  try {
    const utf8Bytes = new TextEncoder().encode(password)
    const base64 = btoa(String.fromCharCode(...utf8Bytes))
    return base64
  } catch (error) {
    console.error('Field encoding failed:', error)
    throw new Error('Encoding failed. Please check your input.')
  }
}
