refactor: address panics due to indexing and slicing (#3233)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Files to modify:


**admin.rs**
  Modify existing code

**validate.rs**
  Modify existing code

**crypto.rs**
  Modify existing code

**pii.rs**
  Modify existing code

**response_modifier.rs**
  Modify existing code

**state_machine.rs**
  Modify existing code

**dir.rs**
  Modify existing code

**knowledge.rs**
  Modify existing code

**authorizedotnet.rs**
  Modify existing code

**transformers.rs**
  Modify existing code

**transformers.rs**
  Modify existing code

**transformers.rs**
  Modify existing code

**transformers.rs**
  Modify existing code

**transformers.rs**
  Modify existing code

**transformers.rs**
  Modify existing code

**transformers.rs**
  Modify existing code

**transformers.rs**
  Modify existing code

**transformers.rs**
  Modify existing code

**transformers.rs**
  Modify existing code

**transformers.rs**
  Modify existing code

**transformers.rs**
  Modify existing code

**transformers.rs**
  Modify existing code

**transformers.rs**
  Modify existing code

**transformers.rs**
  Modify existing code

**transformers.rs**
  Modify existing code

**utils.rs**
  Modify existing code

**transformers.rs**
  Modify existing code

**transformers.rs**
  Modify existing code

**helpers.rs**
  Modify existing code

**encryption.rs**
  Remove:
    - function: private::new
    - function: private::advance
    - function: pub::encrypt
    - function: pub::decrypt
    - function: private::generate_key
    - function: private::test_enc
    - struct: private::NonceGen
    - impl: impl NonceGen
    - impl: impl NonceSequence for NonceGen

**payment_sync.rs**
  Modify existing code

**integration_demo.rs**
  Modify existing code

**refunds.rs**
  Modify existing code

**storage.rs**
  Modify existing code

**selenium.rs**
  Modify existing code