Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7739269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:28:52+00:00 2026-06-01T08:28:52+00:00

Language: vb.net File size: 1GB, and stuff. Encoding of the text file: UTF8 (so

  • 0

Language: vb.net
File size: 1GB, and stuff.

Encoding of the text file: UTF8 (so each character is represented by different numbers of bytes).

Collation: UnicodeCI (when several characters are essentially the same, the most popular version will be the one unique.). I think I know how to handle t his one.

Because each character is represented by different numbers of bytes and each line has different numbers of characters, the number of bytes in each line also vary.

I suppose we have to compute hash for each line. We also need to store buffers location where the line each. Then we have to compare buffers. Then we will check whether the same line shows up or not.

Is there special functions best for that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T08:28:53+00:00Added an answer on June 1, 2026 at 8:28 am

    Depending on how long the lines are, you may be able to compute an MD5 hash value for each line and store than in a HashMap:

    Using sr As New StreamReader("myFile")
        Dim lines As New HashSet(Of String)
        Dim md5 As New Security.Cryptography.MD5Cng()
    
        While sr.BaseStream.Position < sr.BaseStream.Length
            Dim l As String = sr.ReadLine()
            Dim hash As String = String.Join(String.Empty, md5.ComputeHash(System.Text.Encoding.UTF8.GetBytes(l)).Select(Function(x) x.ToString("x2")))
    
            If lines.Contains(hash) Then
                'Lines are not unique
                Exit While
            Else
                lines.Add(hash)
            End If
        End While
    End Using
    

    Untested, but this may be fast enough for your needs. I can’t think of something much faster that still maintains some semblance of conciseness 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Assembly in .net Framework is, as I understand, intermediate language file + some metadata,
I trying to use a .h file from Windows SDK in a .NET language
I have a asp.net resouce language file in english and I have to translate
ASP.NET has build-in functionality to automatically load the correct language resource file based on
I wonder, if C#.NET is managed language, why does it produce .dll file and
I am using vb.net language I have a dropdownlist, which is filled by below
Looking at the C# and VB.NET language specs I think it says that the
This is a question about the VB.NET language. Since I am using it every
What's the best way, using C# or other .NET language, to determine if a
I Adobe Air completly JavaScript? Can't I use a .NET language like VB.NET or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.