🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

oldphonekeypaddecoder

Package Overview
Dependencies
Maintainers
0
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

oldphonekeypaddecoder

1.0.0-ci.42
NuGet
Version published
Maintainers
0
Created
Source

OldPhoneKeypadDecoder

A .NET library that converts numeric keypad sequences into text, simulating classic mobile phone text input (T9). Implements the Chain of Responsibility pattern for processing multi-press character sequences, special characters, backspace, and spaces.

.NET CI/CD codecov

Features

  • Multi-press character selection (e.g., pressing '2' three times gives 'C')
  • Special characters through the '1' key
  • Backspace (*) and confirmation (#) functionality
  • Space character through '0' key
  • Pause between characters using space
  • Chain of Responsibility pattern for extensible character handling

Installation

dotnet add package OldPhoneKeypadDecoder
using OldPhoneKeypadDecoder.Services;
using OldPhoneKeypadDecoder.Strategies;
// Create the decoder service
var keyLayoutStrategy = new OldPhoneKeyLayoutStrategy();
var decoderService = new OldPhoneKeypadDecoderService(keyLayoutStrategy);
// Decode input
string result = decoderService.Decode("44433555555666#"); // Returns "HELLO"

Input Format

  • Numbers (2-9): Letters (press multiple times for different letters)
  • 1: Special characters (&, ', ()
  • 0: Space character
  • *: Backspace
  • #: Confirm/End input
  • Space: Pause between characters

Key Mappings

  • 1 -> &, ', (
  • 2 -> A, B, C
  • 3 -> D, E, F
  • 4 -> G, H, I
  • 5 -> J, K, L
  • 6 -> M, N, O
  • 7 -> P, Q, R, S
  • 8 -> T, U, V
  • 9 -> W, X, Y, Z
  • 0 -> Space

Examples

decoderService.Decode("2#") // "A"
decoderService.Decode("22#") // "B"
decoderService.Decode("222#") // "C"
decoderService.Decode("44 444#") // "HI"
decoderService.Decode("44433 555#") // "IE"
decoderService.Decode("227#") // "B" (backspace removes 'A')

Project Structure

  • src/OldPhoneKeypadDecoder/: Core library
  • src/OldPhoneKeypadDecoder.ConsoleApp/: Console application demo
  • tests/OldPhoneKeypadDecoder.Tests/: Unit tests

Documentation

Development

# Clone the repository
git clone https://github.com/thromel/OldPhoneKeypadDecoder.git
# Build the solution
dotnet build
# Run tests
dotnet test
# Run console demo
dotnet run --project src/OldPhoneKeypadDecoder.ConsoleApp

Contributing

  • Fork the repository
  • Create your feature branch (git checkout -b feature/amazing-feature)
  • Commit your changes (git commit -m 'Add some amazing feature')
  • Push to the branch (git push origin feature/amazing-feature)
  • Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Keywords

phone

FAQs

Package last updated on 18 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts